JavaScript

A5.u.arraymatch Method

Syntax

A5.u.array.match(array,item[,start])

Arguments

arrayarray

The array to match the item in.

itemany

The item to match in the array.

startnumber

The index on the array to start matching from. A negative value will be offset from the end of the array with "-1" being the last index.

Returns

indexnumber

The matching index.

Description

Get the first index an item that matches the passed in item.

Example

var a = [1,2,4,5,7,8];
var match = A5.u.array.match(a,3);
// match = -1
match = A5.u.array.match(a,2);
// match = 1